{% extends "./tmplinfo.html" %}
{% block head %}
<title>{{ kwd['breadtilte'] }} OSGeo中国中心 | 开放地理空间实验室 </title>
<meta name="keywords" content="GIS,地理信息系统,开源GIS,OSGeo,OpenLayers,MapServer,GDAL,GIS教程,WebGIS">
<meta name="description" content="OSGeo中国中心实验室，关注开源GIS，开放数据">

<script type="text/javascript">
    var obj = {};
    function change(span) {
        $('span[name="' + $(span).attr('name') + '"]').each(function () {
            if (this.checked && this != span) {
                this.className = "label label-default";
                this.checked = false;
            }
        });
        obj[$(span).attr('name')] = $(span).attr('value');
        span.className = "label label-primary";
        span.checked = true;
        tt = span.value;
        select();
    }
    function select() {

        // 选择之后，将条件放到 url 中，
        var html_condition = window.location.href + '/con';
        var html_pagination = window.location.href + '/num';
        for (var ii in obj) {
            if (obj[ii] != '') {
                html_condition += '/' + ii + '/' + obj[ii];
                html_pagination += '/' + ii + '/' + obj[ii];
            }
        }

        $('#resultSpan').load(html_condition);
        $('#resultFenye').load(html_pagination);
    }

</script>

<script type="text/javascript">
    $(function () {
        select();
    });
</script>

<script type="text/javascript">
    function keyword_del(key_name, id_num) {

        id_num = id_num.toString();

        var AjaxUrl = "/info_tag/remove/" + key_name;

        $.getJSON(AjaxUrl, function (Json) {

            $("#del_key_" + id_num).html('');

            select();
        });
    }
</script>
{% end %}
{% block typebody %}

<div class="row">
    <div class="col-sm-8">

        <ol class="breadcrumb">
            <li>当前位置： <a href="/">首页</a></li>

            <li><a href="/filter/{{pcatinfo.uid}}">{{pcatinfo.name}}</a></li>
            {% if catinfo %}
            <li><a href="/filter/{{catinfo.uid}}">{{catinfo.name}}</a></li>
            {% end %}
            {% if userinfo and( userinfo.role[1] >= '2') %}
            <li><a href="/publish/{{ widget_info['parentid'] }}" class="btn btn-primary btn-sm">
                发布 {{ widget_info['catname'] }} 数据</a></li>
            {% end %}
        </ol>

        <div class="panel panel-black">
            <div class="panel-heading">
                <b>{{ widget_info['catname'] }}</b><em></em>

            </div>
            <div class="panel-body">
                <ul class="list-group">
                    {% block infolist %} {% end %}
                </ul>

                <div class="clear"></div>
                <div class="iga_pagination">
                    <span id="resultFenye"></span>
                </div>
                <div class="clear"></div>
                <div class="row">
                    <div class="col-sm-12">
                        {% module baidu_share() %}
                    </div>
                </div>
            </div>
        </div>
        <br>
    </div>
    <div class="col-sm-4">
        <div class="alert alert-warning">关键词过滤：
            {% set ii = 0 %}
            {% for x in condition_arr %}
            <span id="del_key_{{ ii }}">
                <a href="/info_tag/{{ x }}">{{ x }}</a>
                <a onclick="keyword_del('{{ x }}', {{ ii }} );">
                    <span style="color: red; cursor: pointer">x</span>
                </a>
            </span>
            {% set ii = ii + 1 %}
            {% end %}
        </div>
        <ul class="list-group">
            {% block infoselect %} {% end %}
        </ul>
        <div class="panel panel-black">
            <div class="panel-heading">
                <span class="title colorme">
                {% for taginfo in cat_enum %}
                {% if taginfo.uid.endswith('00') %}
                {{ taginfo.name }}
                {% end %}
                {% end %}
                </span>
            </div>
            <ul class="list-group">
                {% for taginfo in cat_enum %}
                {% if not taginfo.uid.endswith('00') %}
                <li class="list-group-item"><a href="/filter/{{ taginfo.uid }}">{{ taginfo.name }}</a></li>
                {% end %}
                {% end %}
            </ul>
        </div>
    </div>
</div>
{% end %}
